<?php
include_once("../modules/checkA.php");
include_once("../../config.php"); 
$plate=select_one_line_all_items($table_Prefix."plate","mid = 'ticket'");
?>


<?
//用来判断当前系统属于什么板块
$system_part = $plate['mid'];
include_once("detail-list-function.php"); 
?>
  



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include_once(ROOT_PATH_.'/controlbase/modules/head.php'); ?>
</head>

<body>
 



 
<?php


$new_detail_name        = addslashes($_REQUEST['name']);
$new_detail_ticketdate  = addslashes($_REQUEST['ticketdate']);
$new_detail_principal   = addslashes($_REQUEST['principal']);
$new_detail_cost        = addslashes($_REQUEST['cost']);
$new_detail_remark      = addslashes($_REQUEST['remark']);
$new_detail_mark        = addslashes($_REQUEST['mark']);
$new_detail_status      = addslashes($_REQUEST['status']);
$new_detail_equipmentid = addslashes($_REQUEST['equipmentid']);
$new_detail_authur      = addslashes($_SESSION['username']);



//
////先检查一下车辆的状态，如果是已经借出或者维修，否则就不要出去了。
//
//$equipment=select_one_line_all_items($table_Prefix."equipment","nid = '".$new_detail_equipmentid."'");
//
//
//if($equipment['status']!="正常")
//{
//?>
<!--<script type="text/javascript">-->
<!--    alert("设备状态异常，请检查再借出.");-->
<!--   document.location.href = "../equipment/detail-list.php?nav-itemed=rental";-->
<!--</script>-->
<!---->
<?//
//
//}
//
//else{}



$new_detail_name        = addslashes($_REQUEST['name']);
$new_detail_ticketdate  = addslashes($_REQUEST['ticketdate']);
$new_detail_principal   = addslashes($_REQUEST['principal']);
$new_detail_cost        = addslashes($_REQUEST['cost']);
$new_detail_remark      = addslashes($_REQUEST['remark']);
$new_detail_dealremark      = addslashes($_REQUEST['dealremark']);
$new_detail_mark        = addslashes($_REQUEST['mark']);
$new_detail_status      = addslashes($_REQUEST['status']);
$new_detail_equipmentid = addslashes($_REQUEST['equipmentid']);
$new_detail_authur      = addslashes($_SESSION['username']);

//设置需要搜索的表格的前缀后缀
$table_Suffix = $plate['mid'];
$table = $table_Prefix . $table_Suffix;
//设置需要搜索的表格的前缀后缀
 
 

$sql = "INSERT INTO $table (
name,
status,
authur,
remark,
ticketdate,
cost,
mark,
principal,
dealremark,
equipmentid
)

value (
'$new_detail_name',
'$new_detail_status',
'$new_detail_authur',
'$new_detail_remark',
'$new_detail_ticketdate',
'$new_detail_cost',
'$new_detail_mark',
'$new_detail_principal',
'$new_detail_dealmark',
'$new_detail_equipmentid'

)";


$query = mysql_query($sql) or die ('添加数据失败！！');



mysql_close($con);


?>





<script type="text/javascript">
   alert("输入信息已保存，点击确认返回继续操作.");
    document.location.href = "detail-list.php?nav-itemed=equipment";
</script>
</body>